package com.example.demo.service.impl;

import com.example.demo.mapper.Score2Mapper;
import com.example.demo.pojo.Score2;
import com.example.demo.service.Score2Service;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class Score2ServiceImpl implements Score2Service {

    @Resource
    private Score2Mapper score2Mapper;

    @Override
    public void addScore(Score2 score) {
        score2Mapper.addScore(score);
    }

    @Override
    public void deleteScore(Integer studentId) {
        score2Mapper.deleteById(studentId);
    }

    @Override
    public void updateScore(Score2 score) {
        score2Mapper.update(score);
    }

    @Override
    public List<Score2> getAllScores() {
        return score2Mapper.selectAll();
    }

    @Override
    public Score2 getScoreById(Integer studentId) {
        return score2Mapper.selectById(studentId);
    }
}












